////////////////////////////////////////////////////////////////////////////////
//
//  MICROSOFT CORPORATION
//  Copyright (c) Microsoft Corporation.
//  All Rights Reserved.
//
//  NOTICE: Microsoft Confidential. Intended for Internal Use Only.
//
////////////////////////////////////////////////////////////////////////////////

package com.msn.beet.events
{

import flash.events.Event;

/**
 * For throwing LocalConnection error events and error level status events
 * as Errors.
 *
 */
public class LocalConnectionEvent extends Event
{
    include "../core/Version.as";

    public static const UNDEFINED_ERROR_EVENT:String = "undefinedError";
    public static const ASYNCH_ERROR_EVENT:String = "asynchError";
    public static const STATUS_ERROR_EVENT:String = "statusError";
    public static const SECURITY_ERROR_EVENT:String = "securityError";
    public static const MULTIPLE_CONNECTIONS_ERROR_EVENT:String =
        "multipleConnectionsError";
    public static const ARGUMENT_ERROR_EVENT:String = "argumentErrorEvent";

    protected var _message:String;
    protected var _originator:Object;

    /**
     * @param message
     * @param id
     * @param originator     The original event or error object.
     */
    public function LocalConnectionEvent(type:String, message:String,
                                         originator:Object = null)
    {
        super(type);

        _message = message;
        _originator = originator;
    }

    override public function toString():String
    {
        return _message + "\nOriginal Error or Event: " + _originator;
    }

    public function get originator():Object
    {
        return _originator;
    }

    public function get message():String
    {
        return _message;
    }
}

}
